-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Michael Agard #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Michael Agard #2
Conversation
| if arr[j] < arr[smallest_index]: | ||
| smallest_index = j | ||
| # TO-DO: swap | ||
| arr[cur_index], arr[smallest_index] = arr[smallest_index], arr[cur_index] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice job with the inline swapping syntax.
| smallest_index = j | ||
| # TO-DO: swap | ||
| arr[cur_index], arr[smallest_index] = arr[smallest_index], arr[cur_index] | ||
| return arr |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works! Great job on this function.
| arr[cur_index - 1] = arr[cur_index] | ||
| arr[cur_index] = temp | ||
| cur_index -= 1 | ||
| return arr |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm happy to say you got this one working, too. Maybe today you can work on quicksort in the recursive file. 😄
@blauente